package com.ruoyi.neo.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Relationship;

import java.util.List;

/**
 * 零件信息对象 part
 * 
 * @author ruoyi
 * @date 2025-03-12
 */
@Node(labels = "Part")
public class Part extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    @Id
    private String partNumber;

    /** 零件名称 */
    @Excel(name = "零件名称")
    private String partName;

    /** 分类编号 */
    @Excel(name = "分类编号")
    private Long categoryId;

    /** 零件描述 */
    @Excel(name = "零件描述")
    private String description;

    @Relationship(type = "BELONG TO", direction = Relationship.Direction.OUTGOING)
    private PartCategory partCategory;

    @Relationship(type = "HAS_VIEW", direction = Relationship.Direction.OUTGOING)
    private List<PartView> partViews;

    public void setPartNumber(String partNumber) 
    {
        this.partNumber = partNumber;
    }

    public String getPartNumber() 
    {
        return partNumber;
    }
    public void setPartName(String partName) 
    {
        this.partName = partName;
    }

    public String getPartName() 
    {
        return partName;
    }
    public void setCategoryId(Long categoryId) 
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId() 
    {
        return categoryId;
    }
    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    public PartCategory getPartCategory() {
        return partCategory;
    }

    public void setPartCategory(PartCategory partCategory) {
        this.partCategory = partCategory;
    }

    public List<PartView> getPartViews() {
        return partViews;
    }

    public void setPartViews(List<PartView> partViews) {
        this.partViews = partViews;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("partNumber", getPartNumber())
            .append("partName", getPartName())
            .append("categoryId", getCategoryId())
            .append("description", getDescription())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
